<?php
class ServButtonEmailRequestForm extends BaseForm
{
    public function configure()
    {
        $this->setWidgets(
                array(
                    'email' => new sfWidgetFormInputText(
                            array('label' => 'Correo Electrónico',),
                            array())
                ));

        $this->widgetSchema->setHelp('email', 'Por ejemplo: correo@ejemplo.com');

        $this->setValidators(array(
            'email' => new sfValidatorEmail(
                    array('required' => true),
                    array(
                        'required' => 'Debe indicar un correo electrónico',
                        'invalid'  => 'Formato de correo electrónico invalido'
                ))
            ));

        $this->widgetSchema->setNameFormat('request[%s]');

        $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

        parent::setup();
    }
}